$OpenBSD: patch-jscpucfg_h,v 1.1 2014/07/13 22:53:24 jasper Exp $

Deal with /usr/include/endian.h only providing BYTE_ORDER

--- jscpucfg.h.orig	Mon Feb 11 23:33:22 2013
+++ jscpucfg.h	Mon Jul 14 00:43:03 2014
@@ -47,16 +47,27 @@
 #elif defined(JS_HAVE_ENDIAN_H)
 # include <endian.h>
 
-# if defined(__BYTE_ORDER)
-#  if __BYTE_ORDER == __LITTLE_ENDIAN
-#   define IS_LITTLE_ENDIAN 1
-#   undef  IS_BIG_ENDIAN
-#  elif __BYTE_ORDER == __BIG_ENDIAN
-#   undef  IS_LITTLE_ENDIAN
-#   define IS_BIG_ENDIAN 1
+# if defined(__BYTE_ORDER) || defined(BYTE_ORDER)
+#  if defined(__BYTE_ORDER)
+#   if __BYTE_ORDER == __LITTLE_ENDIAN
+#    define IS_LITTLE_ENDIAN 1
+#    undef  IS_BIG_ENDIAN
+#   elif __BYTE_ORDER == __BIG_ENDIAN
+#    undef  IS_LITTLE_ENDIAN
+#    define IS_BIG_ENDIAN 1
+#   endif
 #  endif
+#  if defined(BYTE_ORDER)
+#   if BYTE_ORDER == LITTLE_ENDIAN
+#    define IS_LITTLE_ENDIAN 1
+#    undef  IS_BIG_ENDIAN
+#   elif BYTE_ORDER == BIG_ENDIAN
+#    undef  IS_LITTLE_ENDIAN
+#    define IS_BIG_ENDIAN 1
+#   endif
+#  endif
 # else /* !defined(__BYTE_ORDER) */
-#  error "endian.h does not define __BYTE_ORDER. Cannot determine endianness."
+#  error "endian.h does not define __BYTE_ORDER nor BYTE_ORDER. Cannot determine endianness."
 # endif
 
 /* BSDs */
